Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for repository evironments #138

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Conversation

jku
Copy link
Member

@jku jku commented Apr 12, 2024

Add support for repository (deployment) environments.

This likely needs a bit of work still (I still don't fully know what I'm doing with golang and pulumi API is a bit strange). This code has also never been executed yet.

@jku jku changed the title Add envs Add support for repository evironments Apr 12, 2024
main.go Outdated
if err != nil {
return err
}
userId, err := strconv.Atoi(user.Id)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this seems fishy to me -- why is the user.Id a string but then RepositoryEnvironmentReviewerArray takes an int array as argument?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe a difference between the GitHub interface returning strings but pulumi's API assuming IDs are ints?

@jku
Copy link
Member Author

jku commented Apr 12, 2024

cc @haydentherapper

main.go Show resolved Hide resolved
main.go Outdated
if err != nil {
return err
}
userId, err := strconv.Atoi(user.Id)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe a difference between the GitHub interface returning strings but pulumi's API assuming IDs are ints?

Copy link
Contributor

@haydentherapper haydentherapper left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great! @cpanato any thoughts?

@jku
Copy link
Member Author

jku commented Apr 15, 2024

long term I wonder if the approach taken in this repo is maintainable: It's Configuration-as-Code sure... but it's a lot of code. Do we really want to maintain all of this -- what is so special about sigstore CaC that we need to write our own programs for it?

Someone more experienced with this could maybe estimate how this compares to switching the whole system to pulumi yaml (https://www.pulumi.com/docs/languages-sdks/yaml/)? It seems like this would

  • allow us to remove most of the code in this untested repository
  • make it easy to deploy new GitHub features

the cost would be translating sigstore-community to pulumi yaml format.

@jku jku mentioned this pull request Apr 15, 2024
@haydentherapper
Copy link
Contributor

@cpanato did you have thoughts on the above?

Is there much difference between our current configuration language and pulumis?

This allows projects to do things like
* require deployment reviews
* Ensure deployments come from defined set of branches/tags

Signed-off-by: Jussi Kukkonen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants